import { reqRankingListInfo } from '@/api/home'

export default {
    namespaced: true,
    actions: {
        //排行榜
        async getRankingList({ commit }) {
            let result = await reqRankingListInfo()
            if (result.data.code == 200) {
                commit('RANKINGLIST', { artistToplist: result.data.artistToplist, LIST: result.data.list })
            }
        }
    },
    mutations: {
        //存储排行榜
        RANKINGLIST(state, { artistToplist, LIST }) {
            state.artistToplist = artistToplist || {}
            state.LIST = LIST || []
        },
        //决定排行榜是否显示
        ISRANKINGLIST(state, value) {
            state.isRankingList = value
        }
    },
    state: {
        artistToplist: {},//云榜单
        LIST: [], //所有榜单
        isRankingList: false, //是否显示排行榜
    },
    getters: {

    }
}